package avicit.bdp.dgs.qa.dto;

import avicit.bdp.common.base.BaseDTO;
import avicit.bdp.common.dto.request.dds.ProcessSchedulerDto;
import avicit.platform6.core.annotation.log.FieldRemark;
import avicit.platform6.core.annotation.log.Id;
import avicit.platform6.core.annotation.log.LogField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.StringUtils;

import javax.persistence.Column;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 * @金航数码科技有限责任公司
 * @作者：developer
 * @邮箱：developer@avic-digital.com
 * @创建时间： 2023-03-30
 * @类说明：SchedulerDTO
 * @修改记录：
 * @注意事项：
 * @主要功能：调度配置DTO
 */
@ApiModel(value = "SchedulerDTO", description = "调度配置DTO")
@Table(name = "bdp_dgs_qa_scheduler")
public class SchedulerDTO extends BaseDTO {
    /**
     * 主键
     */
    @Id
    @LogField
    @ApiModelProperty(value = "主键")
    @FieldRemark(column = "id", field = "id", name = "id")
    @javax.persistence.Id
    @Column(name = "id")
    private String id;

    /**
     * 质量作业ID
     */
    @LogField
    @ApiModelProperty(value = "质量作业ID")
    @FieldRemark(column = "jobId", field = "jobId", name = "jobId")
    @Column(name = "job_id")
    private String jobId;

    /**
     * 调度类型，0:手动、1:定时
     */
    @LogField
    @ApiModelProperty(value = "调度类型，0:手动、1:定时")
    @FieldRemark(column = "type", field = "type", name = "type")
    @Column(name = "type")
    private Integer type;
    @Transient
    private String typeName;

    /**
     * dds中调度配置
     */
    @Transient
    private ProcessSchedulerDto processSchedulerDto;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public Integer getType() {
        return type;
    }

    public void setType(Integer type) {
        this.type = type;
    }

    public String getTypeName() {
        return typeName;
    }

    public void setTypeName(String typeName) {
        this.typeName = typeName;
    }

    public ProcessSchedulerDto getProcessSchedulerDto() {
        return processSchedulerDto;
    }

    public void setProcessSchedulerDto(ProcessSchedulerDto processSchedulerDto) {
        this.processSchedulerDto = processSchedulerDto;
    }

    @Override
    public String getLogFormName() {
        if (StringUtils.isEmpty(super.logFormName)) {
            return "调度配置模块";
        } else {
            return super.logFormName;
        }
    }

    @Override
    public String getLogTitle() {
        if (StringUtils.isEmpty(super.logTitle)) {
            return "调度配置";
        } else {
            return super.logTitle;
        }
    }
}
